Android Studio Gradle
複数の build.gradle
Android Studioでは、build.gradle, app/build.gradleの2つがあるのか?
Top-level build file where you can add configuration options common to all sub-projects/modules.
android - Difference between build.gradle(Project) and build.gradle(Module) - Stack Overflowより
appという(sub) プロジェクト| モジュールがあるから? ここでは、appモジュール。
Groovyの読み方
Groovyを知らない人のためのbuild.gradle読み書き入門 - Qiita
$ cat settings.gradle
include: ':app'
に moduleの一覧があり、通常? appのみ
$ ./gradlew tasks
これで、gradle(daemon?)が実行できる。listのみ?
what
What is Gradle in Android Studio? - Stack Overflow
Gradle is a build system. ( #Build_Tool )
how to build your Android APK
It is a JVM based build system,
読んで、良いQAだった思った。知識が溜まってくれば、必要性を感じにくくなるけど。
Gradle User Guide
Gradle Plugin
speedUp
How to speed up your slow Gradle builds - Josh Burton - Medium
Tip 1 — Use the latest Android Gradle Plugin
Avoid legacy multidex
Disable multi-APK (in development)
Minimize included resources
Disable PNG Crunching
Use Instant Run
確証がない
Avoid inadvertent changes
Don’t use dynamic dependency versions
Watch the memory
Enable Gradle Caching
code:gradle.properties
org.gradle.caching=true
Debug
Android Studioでエラーログを詳細表示する | RE:ENGINES
buildでのerrorの時に、--stacktrace や --debugしろとmessageがでていたけど、どこで設定するか?がわかってなかった。
上記の記事の説明で、俺でもわかった。
-scan で、もっと細かくやってくれて、temporaryに、grapdle enterprizeの機能を使える?
Kotlin DSLへの移行
Let's migrate to build.gradle.kts - Speaker Deck
ここが一番よさそう。
gradle/kotlin-dsl-samples: Samples builds using the Gradle Kotlin DSL
Migrating Android build scripts from Groovy to Kotlin DSL
tips
個別対応:Android.debug.obsoleteApi=true を、projectレベルの、build.gradle に加える
Android Gradle - Where to add "android.debug.obsoleteApi=true" - Stack Overflow